package com.api.tournament.vo;

import com.api.tournament.model.Stage;
import com.api.tournament.model.StageRank;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class StageVo extends Stage {
    List<StageRank> stageRanks;
    Map<String, List<StageRank>> group;


    public List<StageRank> getStageRanks() {
        return stageRanks;
    }

    public void setStageRanks(List<StageRank> stageRanks) {
        this.stageRanks = stageRanks;
        this.group = stageRanks.stream().collect(Collectors.groupingBy(StageRank::getGroubName));
    }

    public Map<String, List<StageRank>> getGroup() {
        return group;
    }

    public void setGroup(Map<String, List<StageRank>> group) {
        this.group = group;
    }
}
